<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>自学习诊断模块</title>
    <!--<base href="http://localhost:63342/NodeTest/"/>-->
    <link rel="stylesheet" href="../css/main.min.css">
    <script src="../js/main.min.js"></script>
    <script src="../js/moment-with-locales.min.js"></script>
    <script src="./select2.js"></script>
    <script src="../base/core.js"></script>
    <script src="faultTrain2.js"></script>
    <script src="node-tree-view.js"></script>
    <link rel="stylesheet" href="treeview.css">
    <style>
        #faultTreeDiv div{
            border:2px solid black;
        }
        .table td{
            vertical-align: middle;
        }
    </style>
    <style media="print">
        .no-print { display: none }
        .page-next{ page-break-after: always }
    </style>
</head>
<body ng-app="myApp" ng-controller="manageController">
<div class="container-fluid">
    <div class="row">
        <p style="padding-bottom: 8px;">当前成立的故障如下：<a href="#" ng-click="loadFaults()">刷新</a>&nbsp;&nbsp;&nbsp;&nbsp;
            <button style="float: right;color:#0000ff;" class="btn button btn-info" ng-click="submitAll()"><b>本次专家处理结果提交</b></button>
        </p>
        <div ng-repeat="ft in faults" style="border: dotted">
            <p>
                <span style="color:#ff0000;"><b>{{ft.fault.name}}</b></span>&nbsp;&nbsp;&nbsp;&nbsp;置信度&nbsp;＝&nbsp;<b style="color:#05aa03;">{{(fault_prop(ft)*100).toFixed(2)}}%</b>
                请确认故障是否发生？
                <button class="button " ng-class="ft.fault_state==1?'btn-primary':'btn-default'" ng-click="changeState(ft,1)">发生</button>
                <button class="button" ng-class="ft.fault_state==2?'btn-primary':'btn-default'" ng-click="changeState(ft,2)">未发生</button>
                <button class="button" ng-class="ft.fault_state==0?'btn-primary':'btn-default'" ng-click="changeState(ft,0)">不确定</button>
            </p>
            <table class="table table-striped table-responsive ">
                <tr>
                    <!--<th>选择</th>-->
                    <th>特征</th>
                    <th>置信度</th>
                    <th>发生次数</th>
                    <th>初次发生时间</th>
                </tr>
                <tr ng-repeat="feature in ft.features">
                    <!--<td><input type="checkbox" ng-model="feature.checked"></td>-->
                    <td>{{ft.featureNodes[feature.feature_id].getTextWithId()}}</td>
                    <td>{{(feature.frequency / feature.quantum * 100).toFixed(2)}}%</td>
                    <td>{{feature.appear_times}}</td>
                    <td>{{toTimeString(feature.timestamp)}}</td>
                </tr>
            </table>
            <table class="table table-striped">
                <tr>
                    <th>选择</th>
                    <th>原因</th>
                    <th>置信度</th>
                    <th>解决方案</th>
                </tr>
                <tr ng-repeat="reason in ft.reasons">
                    <td><input type="checkbox" name="fault_{{ft.fault.id}}" value="{{reason.id}}" ng-checked="isSelected(ft,reason.id)" ng-click="updateSelection($event,ft,reason.id)"></td>
                    <td>{{reason.getTextWithId()}}</td>
                    <td>{{(ft.reason_map.frequency[reason.id]/ft.reason_map.quantum * 100).toFixed(2)}}%</td>
                    <td>{{reason.solution}}</td>
                </tr>
            </table>
        </div>
    </div>
    <div class="row" style="padding-top: 8px;">
        <button style="float: right;color:#0000ff;" class="btn button btn-info" ng-click="submitAll()"><b>本次专家处理结果提交</b></button>
    </div>
    <div class="row">

    </div>
</div>
</body>
</html>